<template>
	<view>{{num1}}</view>
	<view>这个是num2的值：{{num2 + 1}}</view>
	<view>{{test}}</view>
	<view>{{arr[2]}}</view>
	<view>{{obj}}</view>
	<view>现在时间是：{{Date.now()}}</view>
	<view>这个是随机数：{{Math.random()}}</view>
	<view>三元表达式：{{ 1< 2? '小1' : "大2"}}</view>
	<view>函数的调用：{{ fn()}}</view>
</template>

<script setup>
	
// ref这个是vue的响应式编程
import {ref} from "vue";
	
let num1 = 6;
// setInterval(()=>{
// 	num1++;
// 	console.log(num1);
// },1000)

let num2 = ref(10);
setInterval(()=>{
	num2.value++;
	// 获取响应式变量的值
	console.log(num2.value);
},1000)

let test = ref("咸虾米");

let arr =ref([1,2,3,4]);

let obj = ref({name:"王五",age:18})
obj.value.name = "李四";
obj.value.age = 20

function fn(){
	return '这个是函数的调用';
}
</script>

<style>

</style>
